<script type="text/javascript">
    $(document).ready(function() { 
        $('.nobubble').click(function(event){
            event.stopImmediatePropagation();
        });
    });
</script>
<?php if( osc_count_items() == 0) { ?>
    <div class="search-header span11 columns">
        <h3><?php _e('search results', 'twitter') ; ?></h3>
    </div>
    <div class="span11 columns" style="text-align:center;">
        <br>
        <?php if( osc_search_pattern() == '' ) { ?>
            <h2><?php _e('There are no results', 'twitter') ; ?></h2>
        <?php } else { ?>
            <h2><?php printf( __('There are no results matching "%s"', 'twitter'), osc_search_pattern() ) ; ?></h2>
        <?php } ?>
         <br>
    </div>
<?php } else { ?>
<div class="search-header span11 columns">
    
    <p class="filters">
	<span style="font-weight:bold;font-size:12pt;float:left;" ><?php echo osc_search_total_items() ?> <?php _e('search results', 'twitter') ; ?></span>
	<span style="float:right;">
        <?php _e('Sort by', 'twitter'); ?>:
        <?php $i = 0 ; ?>
        <?php $orders = osc_list_orders();
        foreach($orders as $label => $params) {
            $orderType = ($params['iOrderType'] == 'asc') ? '0' : '1'; ?>
            <?php if(osc_search_order() == $params['sOrder'] && osc_search_order_type() == $orderType) { ?>
                <a class="current" href="<?php echo osc_update_search_url($params) ; ?>"><?php echo $label; ?></a>
            <?php } else { ?>
                <a href="<?php echo osc_update_search_url($params) ; ?>"><?php echo $label; ?></a>
            <?php } ?>
            <?php if ($i != count($orders)-1) { ?>
                <span>&middot;</span>
            <?php } ?>
            <?php $i++ ; ?>
        <?php } ?>
	</span>
    </p>
</div>
<?php
    osc_get_premiums() ;
    if( osc_count_premiums() > 0 ) {
?>
<?php while ( osc_has_premiums() ) { ?>
    <div class="premium line span11 columns"  >
        <div class="photo">
        <?php if( osc_count_premium_resources() ) { ?>
            <a href="<?php echo osc_premium_url() ; ?>">
                <img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="148px" height="110px" title="<?php echo osc_premium_title(); ?>" alt="<?php echo osc_premium_title(); ?>" />
            </a>
        <?php } else { ?>
            <!--<img src="<?php //echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="" title=""/>-->
			sin fotos
        <?php } ?>
        </div>
        <div class="description">
            <h3><?php if( osc_price_enabled_at_items() ) { ?> <strong><?php echo osc_premium_formated_price() ; ?></strong> &middot; <?php } ?><a href="<?php echo osc_premium_url() ; ?>"><?php echo osc_premium_title(); ?></a> <span class="label"><a href="<?php echo osc_item_category_url( osc_premium_category_id() ) ; ?>"><?php echo osc_premium_category() ; ?></a></span>
			</h3>
            <p><?php printf(__('<strong>Publish date</strong>: %s', 'twitter'), osc_format_date( osc_premium_pub_date() ) ) ; ?></p>
            <?php
                $location = array() ;
                if( osc_premium_country() != '' ) {
                    $location[] = sprintf( __('<strong>Country</strong>: %s', 'twitter'), osc_premium_country() ) ;
                }
                if( osc_premium_region() != '' ) {
                    $location[] = sprintf( __('<strong>Region</strong>: %s', 'twitter'), osc_premium_region() ) ;
                }
                if( osc_premium_city() != '' ) {
                    $location[] = sprintf( __('<strong>City</strong>: %s', 'twitter'), osc_premium_city() ) ;
                }

                if( count($location) > 0) { ?>
                    <p><?php echo implode(' &middot; ', $location) ; ?></p>
                <?php } ?>
            <p><?php echo osc_highlight( strip_tags( osc_premium_description() ), 200 ) ; ?></p>
        </div>
    </div>
    <?php } ?>
<?php } ?>
    <?php while ( osc_has_items() ) { ?>
    <div class="line span11 columns" onclick="location.href='<?php echo osc_item_url(); ?>'">
        <div class="photo">
	  <a href="<?php echo osc_item_url() ; ?>"  class="nobubble">
            <?php if( osc_count_item_resources() ) { ?>
           
                <img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="148px" height="110px" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" />
           
            <?php } else { ?>
                <!--<img src="<?php //echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="" title=""/>-->
		sin fotos
            <?php } ?>
	  </a>
        </div>
        <div id="description" class="description">
			
                        <?php if( osc_price_enabled_at_items() && price_format(osc_item_formated_price()) != '') { ?>
                            <span class="label green" >
                            <strong style="font-size:11pt;text-transform: lowercase;margin-bottom:5px;">                            
                                <?php echo price_format(osc_item_formated_price()); ?> 
                            </strong>
                            </span>
                        <?php } ?>
                        
                        <span style="margin-top:5px;">
                            <span style="float:right;">
                                <span class="label grey2" >
                                    <a href="<?php echo osc_item_category_url(osc_item_category_id()) ; ?>"><?php echo osc_item_category(); ?></a>
                                </span>
                            </span> 

                            <?php if( osc_item_is_premium() ) { ?> 
                            <span style="float:right;">
                            <span class="label success"><?php _e('Premium', 'twitter');  ?></span>
                            </span><?php } ?>
                            <span style="padding-right:20px;float:right;display:block;width:80px;text-align:right;">
                            <?php  if( osc_item_region() != '' ) { ?>			

                                     <!--<img src="<?php //echo osc_current_web_theme_url('images/language/' . strtolower(osc_item_country()) . '.png'); ?>" />-->
                                     <?php echo osc_item_region(); ?>


                            <?php } else { ?>
                                    &nbsp;
                            <?php } ?>
                            </span>
                            <span style="padding-right:10px;float:right;"><?php echo osc_format_date( osc_item_pub_date() ) ; ?></span>			
                        </span>
                        
			
			<h3><?php echo osc_item_title(); ?> </h3>
        
			
            <?php
             /*   $location = array() ;
                if( osc_item_country() != '' ) {
                    $location[] = sprintf( __('<strong>Country</strong>: %s', 'twitter'), osc_item_country() ) ;
                }
                if( osc_item_region() != '' ) {
                    $location[] = sprintf( __('<strong>Region</strong>: %s', 'twitter'), osc_item_region() ) ;
                }
                if( osc_item_city() != '' ) {
                    $location[] = sprintf( __('<strong>City</strong>: %s', 'twitter'), osc_item_city() ) ;
                }
                if( count($location) > 0) {*/
            ?>
            <p><?php //echo implode(' &middot; ', $location) ; ?></p>
            <?php //} ?>
            <p style="color:#999999;"><?php echo osc_highlight(strip_tags(osc_item_description()), 200) ; ?></p>
            <div style="padding-top:6px;">
                <strong> 
                    <a href="<?php echo osc_item_url() ; ?>" style="color: #0066CC; text-decoration:underline;" class="nobubble">
                    <?php _e('see more details', 'twitter');  ?> 
                    <?php if(osc_count_item_resources() > 1) { 
                        echo ' '; 
                        _e('and', 'twitter');
                        echo ' ' . osc_count_item_resources() . ' ';
                        _e('photos', 'twitter'); 
                    } ?>
                    </a>
                </strong>
            </div>
        </div>
    </div>
    <?php } ?>
<?php } ?>
<div class="pagination">
        <?php echo twitter_search_pagination() ; ?>
</div>